package aliyun.cx.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import java.time.LocalDateTime;
import java.util.List;

@TableName("comment")
public class Comment {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private String content;
    
    @TableField("user_id")
    private Long userId;
    
    @TableField("article_id")
    private Long articleId;
    
    @TableField("parent_id")
    private Long parentId;
    
    private Integer status; // 评论状态：0-待审核 1-已通过 2-已拒绝
    
    @TableField("like_count")
    private Integer likeCount; // 点赞数
    
    @TableField("ip_address")
    private String ipAddress; // IP地址
    
    @TableField("user_agent")
    private String userAgent; // 浏览器信息
    
    @TableField("is_top")
    private Boolean isTop; // 是否置顶
    
    @TableField("report_count")
    private Integer reportCount; // 被举报次数
    
    @TableField("audit_time")
    private LocalDateTime auditTime; // 审核时间
    
    @TableField("audit_user_id")
    private Long auditUserId; // 审核人 ID
    
    @TableField("create_time")
    private LocalDateTime createTime;
    
    @TableField("update_time")
    private LocalDateTime updateTime;
    
    // 关联字段（非数据库字段）
    @TableField(exist = false)
    private String userName;     // 评论用户名
    
    @TableField(exist = false)
    private String userAvatar;   // 用户头像
    
    @TableField(exist = false)
    private String articleTitle; // 文章标题
    
    @TableField(exist = false)
    private String categoryName; // 文章分类名
    
    @TableField(exist = false)
    private List<Tag> articleTags; // 文章标签列表
    
    @TableField(exist = false)
    private String parentContent; // 父评论内容（用于回复显示）
    
    @TableField(exist = false)
    private String parentUserName; // 父评论用户名
    
    // Getters and Setters
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getContent() {
        return content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public Long getArticleId() {
        return articleId;
    }
    
    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }
    
    public Long getParentId() {
        return parentId;
    }
    
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public Integer getLikeCount() {
        return likeCount;
    }
    
    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }
    
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    
    public String getUserName() {
        return userName;
    }
    
    public void setUserName(String userName) {
        this.userName = userName;
    }
    
    public String getUserAvatar() {
        return userAvatar;
    }
    
    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar;
    }
    
    public String getArticleTitle() {
        return articleTitle;
    }
    
    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }
    
    public String getCategoryName() {
        return categoryName;
    }
    
    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }
    
    public List<Tag> getArticleTags() {
        return articleTags;
    }
    
    public void setArticleTags(List<Tag> articleTags) {
        this.articleTags = articleTags;
    }
    
    public String getParentContent() {
        return parentContent;
    }
    
    public void setParentContent(String parentContent) {
        this.parentContent = parentContent;
    }
    
    public String getParentUserName() {
        return parentUserName;
    }
    
    public void setParentUserName(String parentUserName) {
        this.parentUserName = parentUserName;
    }
    
    // 新增字段的 Getters and Setters
    
    public String getIpAddress() {
        return ipAddress;
    }
    
    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }
    
    public String getUserAgent() {
        return userAgent;
    }
    
    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }
    
    public Boolean getIsTop() {
        return isTop;
    }
    
    public void setIsTop(Boolean isTop) {
        this.isTop = isTop;
    }
    
    public Integer getReportCount() {
        return reportCount;
    }
    
    public void setReportCount(Integer reportCount) {
        this.reportCount = reportCount;
    }
    
    public LocalDateTime getAuditTime() {
        return auditTime;
    }
    
    public void setAuditTime(LocalDateTime auditTime) {
        this.auditTime = auditTime;
    }
    
    public Long getAuditUserId() {
        return auditUserId;
    }
    
    public void setAuditUserId(Long auditUserId) {
        this.auditUserId = auditUserId;
    }
}
